import Cookies from 'js-cookie'

const TOKEN_KEY = 'im-system-token'
const TOKEN_EXPIRE_TIME = 7 // 直接使用数字表示天数

export function getToken() {
  return Cookies.get(TOKEN_KEY)
}

export function setToken(token: string) {
  return Cookies.set(TOKEN_KEY, token, { expires: TOKEN_EXPIRE_TIME })
}

export function removeToken() {
  return Cookies.remove(TOKEN_KEY)
}
